/*
 * An XML document type.
 * Localname: digitalObject
 * Namespace: info:fedora/fedora-system:def/foxml#
 * Java type: fedora.fedoraSystemDef.foxml.DigitalObjectDocument
 *
 * Automatically generated - do not modify.
 */
package fedora.fedoraSystemDef.foxml.impl;

/**
 * A document containing one digitalObject(@info:fedora/fedora-system:def/foxml#) element.
 *
 * This is a complex type.
 */
public class DigitalObjectDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements fedora.fedoraSystemDef.foxml.DigitalObjectDocument
{
    private static final long serialVersionUID = 1L;
    
    public DigitalObjectDocumentImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName DIGITALOBJECT$0 = 
        new javax.xml.namespace.QName("info:fedora/fedora-system:def/foxml#", "digitalObject");
    
    
    /**
     * Gets the "digitalObject" element
     */
    public fedora.fedoraSystemDef.foxml.DigitalObjectDocument.DigitalObject getDigitalObject()
    {
        synchronized (monitor())
        {
            check_orphaned();
            fedora.fedoraSystemDef.foxml.DigitalObjectDocument.DigitalObject target = null;
            target = (fedora.fedoraSystemDef.foxml.DigitalObjectDocument.DigitalObject)get_store().find_element_user(DIGITALOBJECT$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "digitalObject" element
     */
    public void setDigitalObject(fedora.fedoraSystemDef.foxml.DigitalObjectDocument.DigitalObject digitalObject)
    {
        synchronized (monitor())
        {
            check_orphaned();
            fedora.fedoraSystemDef.foxml.DigitalObjectDocument.DigitalObject target = null;
            target = (fedora.fedoraSystemDef.foxml.DigitalObjectDocument.DigitalObject)get_store().find_element_user(DIGITALOBJECT$0, 0);
            if (target == null)
            {
                target = (fedora.fedoraSystemDef.foxml.DigitalObjectDocument.DigitalObject)get_store().add_element_user(DIGITALOBJECT$0);
            }
            target.set(digitalObject);
        }
    }
    
    /**
     * Gets the "digitalObject" element
     */
    public void disconnectObject()
    {
        synchronized (monitor())
        {
            //check_orphaned();
            //if (has_store())
            //	this.disconnect_store();
        }
    }
    
    /**
     * Appends and returns a new empty "digitalObject" element
     */
    public fedora.fedoraSystemDef.foxml.DigitalObjectDocument.DigitalObject addNewDigitalObject()
    {
        synchronized (monitor())
        {
            check_orphaned();
            fedora.fedoraSystemDef.foxml.DigitalObjectDocument.DigitalObject target = null;
            target = (fedora.fedoraSystemDef.foxml.DigitalObjectDocument.DigitalObject)get_store().add_element_user(DIGITALOBJECT$0);
            return target;
        }
    }
    /**
     * An XML digitalObject(@info:fedora/fedora-system:def/foxml#).
     *
     * This is a complex type.
     */
    public static class DigitalObjectImpl extends fedora.fedoraSystemDef.foxml.impl.DigitalObjectTypeImpl implements fedora.fedoraSystemDef.foxml.DigitalObjectDocument.DigitalObject
    {
        private static final long serialVersionUID = 1L;
        
        public DigitalObjectImpl(org.apache.xmlbeans.SchemaType sType)
        {
            super(sType);
        }        
    }
}
